package org.jeecg.modules.online.cgform.converter.p011b;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.modules.online.cgform.converter.p010a.ForeseeConvert;
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
import org.jeecg.modules.online.cgform.utils.CgformUtil;

/* renamed from: org.jeecg.modules.online.cgform.converter.b.j */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/modules/online/cgform/converter/b/j.class */
public class SwitchConverter extends ForeseeConvert {
    public SwitchConverter(OnlCgformField onlCgformField) {
        String fieldExtendJson = onlCgformField.getFieldExtendJson();
        String str = "Y";
        String str2 = "N";
        if (fieldExtendJson != null && !"".equals(fieldExtendJson)) {
            JSONArray jSONArray = null;
            try {
                jSONArray = JSONArray.parseArray(fieldExtendJson);
            } catch (Exception e) {
                JSONObject parseObject = JSONArray.parseObject(fieldExtendJson);
                if (parseObject.containsKey(CgformUtil.f302aV)) {
                    jSONArray = parseObject.getJSONArray(CgformUtil.f302aV);
                }
            }
            if (jSONArray != null && jSONArray.size() == 2) {
                str = jSONArray.get(0).toString();
                str2 = jSONArray.get(1).toString();
            }
        }
        ArrayList arrayList = new ArrayList();
        DictModel dictModel = new DictModel(str, "是");
        DictModel dictModel2 = new DictModel(str2, "否");
        arrayList.add(dictModel);
        arrayList.add(dictModel2);
        this.f175b = arrayList;
        this.f174a = onlCgformField.getDbFieldName();
    }
}
